package com.bdqn.petmalldemo.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author Lenovo
 * @since 2020-02-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_user")
@ApiModel(value="User对象", description="")
public class User implements Serializable {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "用户id")
      @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "用户名")
    private String username;

    @ApiModelProperty(value = "登录密码")
    private String password;

    @ApiModelProperty(value = "真实姓名")
    private String realname;

    @ApiModelProperty(value = "性别( 0:女 1:男 2:保密 )")
    private Integer gender;

    @ApiModelProperty(value = "电子邮箱")
    private String email;

    @ApiModelProperty(value = "手机号码")
    private String phone;

    @ApiModelProperty(value = "联系地址")
    private String address;

    @ApiModelProperty(value = "邮政编码")
    private String zipCode;

    @ApiModelProperty(value = "找回密码-问题")
    private String question;

    @ApiModelProperty(value = "找回密码-答案")
    private String answer;

    @ApiModelProperty(value = "角色( 1:普通用户, 2:管理员 )")
    private Integer role;

    @ApiModelProperty(value = "登录ip地址")
    private String loginIp;

    @ApiModelProperty(value = "登录时间")
      @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime loginTime;

    @ApiModelProperty(value = "宠物数量")
    private Integer petNum;

    @ApiModelProperty(value = "在售宠物数量")
    private Integer onsalePetNum;

    @ApiModelProperty(value = "粉丝数量")
    private Long fansNum;

    @ApiModelProperty(value = "收藏数量")
    private Integer followNum;

    @ApiModelProperty(value = "用户状态( 1:正常 2:禁用 )")
    private Integer status;

    @ApiModelProperty(value = "创建时间")
      @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date  createTime;


}
